package com.tql.test_03;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

public class Test1 {
    public static void main(String[] args) {
      /*  List<String> list = new Vector<>();*/
        List<String> list = new CopyOnWriteArrayList<>();
        for (int i = 0; i < 10; i++) {
            new Thread(()->{
               list.add(UUID.randomUUID().toString().substring(0,5));
            },"线程"+i).start();
            System.out.println(list);
            System.out.println(UUID.randomUUID().toString().substring(0,5));
        }
    }
}
